﻿using CardPlay.Model.CardModel;
using CardPlay.Model.GameModel;
using CardPlay.Model.GameModel.Actions;

namespace CardPlay.DemoPack.Games.KlondikeVariants
{
    [Game("BDA31D0A-C430-4DF4-ACD3-1381DE5C730B", LevelOfDifficulty.Medium, LevelOfSkill.MostlySkill, DurationOfPlay.MoreThan10Minutes, 
        NumberOfDecks = 2, Family = FamilyName)]
    public class Carlton : AgnesSorel
    {
        public Carlton()
        {
            TotalDecks = 2;
            TotalFoundations = 8;
            TotalTableaus = 8;
            TableauBuildSequence = CardFaceSequence.AlternatingColorDescendingRank;
        }

        protected override void PrepareDealScript(DealScript script)
        {
            for (var i = 1; i <= TotalTableaus; ++i)
                script.Deal(i + " up").To(StandardPileNames.PrefixForTableau + i);

            script.DealRemainingFaceDownTo(Stock);
        }

        protected override bool AllowedToBuildEmptyTableau(MovePileAction action)
        {
            return action.PileBeingMoved.BottomCard.Rank != FoundationBaseRank;
        }
    }
}